def check_data(origin_data, no_value_data):
    """
    把原始数据筛选成无重复项，判断这些词是否在无商业价值词库中
    :param origin_data: 原始数据
    :param no_value_data: 无商业价值的词
    :return: 筛选原始数据无重复项词，筛选排查的词，排查剩下的词
    """
    lst1 = []
    for i in origin_data:
        lst1.extend(i.split())
    set_origin_data = list(set(lst1))

    value_words = []
    for j in set_origin_data:
        if j in no_value_data:
            value_words.append(j)
    no_value_words = list(set(no_value_data) - set(value_words))
    return set_origin_data, value_words, no_value_words


if __name__ == '__main__':
    origin_data = ["li jie", "dong guang wen", "car in plugging", "car extends cable",
                   "ev charging cable", "car stock", "cars wire", "cable leads"]
    no_value_data = ["abedare", "abilities", "afffect", "wire", "leads", "afffact", "afffict"]
    ret = check_data(origin_data, no_value_data)
    print(origin_data, no_value_data)
    print(ret)
